package top.jiangqiang.qyblog.core.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;
import top.jiangqiang.qyblog.core.validate.Allow;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author jiangqiang
 * @date 2022-11-29
 */
@Accessors(chain = true)
@Data
@Schema(name = "新增导航", description = "")
public class NavAddDto implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "导航栏名称")
    private String name;

    @Schema(description = "导航路径，也可以是完整的URL链接，子菜单和父级菜单之间的路径是完全独立的")
    @NotBlank(message = "导航路径不能为空")
    private String path;

    @Schema(description = "简介")
    private String introduction;

    @Schema(description = "菜单元数据，设置一些数据给前端页面使用")
    private String metadata;

    @Schema(description = "是否隐藏，默认显示", defaultValue = "false")
    private Boolean hide = false;

    @Schema(description = "打开方式 1新开窗口/0当前窗口", defaultValue = "0")
    @Allow(allowValues = {"0", "1", "null"}, message = "打开方式参数无效")
    private Integer openStyle = 0;

    @Schema(description = "父菜单ID，顶级菜单为0", defaultValue = "0")
    private Long parentId = 0L;

    @Schema(description = "菜单排序", defaultValue = "0")
    private Integer sort = 0;
}
